﻿using DGZImp.ApsProject.DomainModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DGZImp.ApsProject.Dtos
{
    internal class Aps_Schedule
    {
    }
    public class ResGanttChartData
    {
        public List<DateTime> restDays { get; set; }

        public List<ResLeanApsLineCalendarInfo> lineCalendars { get; set; }

        public List<Aps_ScheduleTask> tasks { get; set; }

        public List<Aps_ScheduleTaskDate> taskDates { get; set; }
    }

    public class ReqDistributedTask : Aps_DistributedTask
    {

    }

    public class ReqGetSalerOrder
    {
        public List<long?> ids { get; set; }

        public string query { get; set; }

        public int page { get; set; }
        public int size { get; set; }

    }
    public class ReqGanttChartData
    {
        /// <summary>
        /// 排程版本Id
        /// </summary>
        public long ScheduleVersionId { get; set; }

        /// <summary>
        /// 工序ID
        /// </summary>
        public List<long?> GroupIds { get; set; }
    }
    public class ReqOrderTaskData
    {
        /// <summary>
        /// 排程版本Id
        /// </summary>
        public long ScheduleVersionId { get; set; }

        /// <summary>
        /// 工序ID
        /// </summary>
        public List<long?> OrderIds { get; set; }
    }
    public class ReqGanttChartDataByMachine
    {
        /// <summary>
        /// 排程版本Id
        /// </summary>
        public long ScheduleVersionId { get; set; }

        /// <summary>
        /// 工厂ID
        /// </summary>
        public long? PlantId { get; set; }

        /// <summary>
        /// 工序ID
        /// </summary>
        public List<long> MachineIds { get; set; }

        /// <summary>
        /// 几天前
        /// </summary>
        public int agoDay { get; set; } = 0;
    }



    public class ReqSendTask
    {
        /// <summary>
        /// 排程任务id
        /// </summary>
        public List<long?> ScheduleTaskIds { get; set; }
    }




    public class ReqGanttTable
    {
        public DateTime? MinDate { get; set; }
        public DateTime? MaxDate { get; set; }
        public List<ResScheduInfo> task { get; set; }
        public List<ResScheduDate> taskDate { get; set; }
        public List<ResLeanApsLineCalendarInfo> calendar { get; set; }

        public List<DateTime> restDays { get; set; }

    }
    public class ReqGanttTableMachine
    {
        public DateTime? MinDate { get; set; }
        public DateTime? MaxDate { get; set; }
        public List<ResScheduInfo> task { get; set; }
        public List<ResScheduDate> taskDate { get; set; }
        public List<MachineShift> calendar { get; set; }

        public List<DateTime> restDays { get; set; }

    }
    public class ReqGanttTableCalculate
    {
        public DateTime? MinDate { get; set; }
        public DateTime? MaxDate { get; set; }
        public List<ResScheduInfo> task { get; set; }
        public List<ResScheduDate> taskDate { get; set; }
        public List<MachineShift> calendar { get; set; }

        public List<DateTime> restDays { get; set; }

        public List<Aps_ScheduleTask> tasks { get; set; }

        public List<Aps_ScheduleTaskDate> taskDates { get; set; }

    }

    public class ResScheduInfo : Aps_ScheduleTask
    {

        public DateTime? StartTime { get; set; }
        public DateTime? EndTime { get; set; }

        public string GroupCodeName { get; set; }
        public string GroupCode { get; set; }
        public string GroupName { get; set; }

        /*        public long? ScheduleTaskId { get; set; }
                public long? SalesOrderId { get; set; }
                public long? SalesMaterialId { get; set; }
                public string MoCode { get; set; }
                public string PreMoCode { get; set; }
                public string ProductsCode { get; set; }
                public decimal? UPH { get; set; }
                public decimal? PreparationMinutes { get; set; }
                public decimal? BeforeMinutes { get; set; }
                public decimal? AfterMinutes { get; set; }
                public decimal? Qty { get; set; }
                public decimal? Weight { get; set; }

                public DateTime? DeadLine { get; set; }
                public long? GroupId { get; set; }*/
    }
    public class ResScheduDate
    {
        public long? GroupId { get; set; }
        public long? ScheduleTaskId { get; set; }
        public string MoCode { get; set; }
        public string ProductsCode { get; set; }
        public decimal? Qty { get; set; }
        public decimal UPH { get; set; }
        public DateTime? WorkDate { get; set; }
        public List<ScheduleList> Details { get; set; }
    }

    public class ScheduleList : Aps_ScheduleTaskDate
    {
        public string MachineName { get; set; }
        public string MachineCode { get; set; }
        public long? GroupId { get; set; }
        public long? ScheduleTaskId { get; set; }
        public string GroupName { get; set; }
        public string GroupCode { get; set; }
        public decimal? UPH { get; set; }
        public decimal? PreparationMinutes { get; set; }
        public decimal? BeforeMinutes { get; set; }
        public decimal? AfterMinutes { get; set; }
    }
    public class PostUserWork
    {
        public string MachineCodeName { get; set; }
        public List<long?> MachineId { get; set; }
        public string UserName { get; set; }
        public string PostValue { get; set; } // 岗位名称
        public List<ScheduleTaskDateAndMachine> Childrens { get; set; } // 岗位名称
    }
    public class ScheduleTaskDateAndMachine : Aps_ScheduleTaskDate
    {
        public string MachineCodeName { get; set; }
    }
    public class ReqPostUserWork
    {
        public string UserName { get; set; }

        public DateTime? StartTime { get; set; }
        public DateTime? EndTime { get; set; }

        public long? ScheduleVersionId { get; set; }

    }
}
